package com.chinasoft.ssm.service.impl;

import com.chinasoft.ssm.mapper.BikeMapper;
import com.chinasoft.ssm.pojo.Bike;
import com.chinasoft.ssm.service.BikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BikeServiceImpl implements BikeService {
    @Autowired
    BikeMapper bikeMapper;

    @Override
    public List<Bike> selectAll() {
        return bikeMapper.findAll();
    }

    @Override
    public Bike select(Integer id) {


        return bikeMapper.findById(id);
    }

    @Override
    public Integer delete(Integer id) {

        return bikeMapper.delete(id);
    }

    @Override
    public Integer insert(Bike bike) {
        return bikeMapper.insert(bike);
    }

    @Override
    public Integer update(Bike bike) {
        return bikeMapper.update(bike);
    }

    @Override
    public List<Bike> select15() {
        return bikeMapper.select15();
    }

    @Override
    public List<Bike> selectcat(String category) {
        return bikeMapper.findBycatId(category);
    }
}
